<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>北京联合大学</title>
</head>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_835526_xufba1hg66.css">
<link rel="stylesheet" href="../..//css/Initialization.css">
<link rel="stylesheet" href="../..//css/commen.css">
<link rel="stylesheet" href="../..//css/password.css">
<body>
<div id="content">
        <div class="initer">
            <!-- 具体内容 -->
            <div class="bread">
                <div class="plain">
                    我的信息
                </div>
                <div class="plain">
                    <i class="iconfont icon-right"></i>
                </div>
                <div class="plain current">
                    修改密码
                </div>
            </div>
            <div class="modifypassword">
                <div class="modifyinput">
                    <span class="text">原密码</span>
                    <input type="password" placeholder="请输入原密码" name="password" id="password">
                </div>
                <div class="modifyinput">
                    <span class="text">新密码</span>
                    <input type="password" placeholder="请输入新密码" name="repass" id="repass">
                </div>
                <div class="modifyinput">
                    <span class="text">确认新密码</span>
                    <input type="password" placeholder="请确认新密码" name="repass1" id="repass1">
                </div>
                <div class="modifyinput">
                    <span class="center-button" id="subBut">修改密码</span>
                </div>
            </div>
        </div>
</div>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/commen.js"></script>
<script>
    $("#subBut").click(function(){
        var password = $("#password").val();
        var repass = $("#repass").val();
        var repass1 = $("#repass1").val();

        if(password.length == 0){
            $("#password").focus();
            alert("请输入原密码");
            return false;
        }else if(repass.length == 0){
            $("#repass").focus();
            alert("请输入新密码");
            return false;
        }else if(repass != repass1){
            alert("两次密码输入不一致");
            $("#repass1").focus();
            return false;
        }else{
            $.ajax({
                type : "POST",
                url : "../person/tochangepass",
                data : {password: password, repass: repass},
                dataType : "json",
                success : function(json) {
                    alert(json.result);
                },
                error:function(msg){
                    alert("程序出错，请联系管理员");
                }
            });
        }
    });
</script>
</body>
</html>

